import { useEffect } from 'react'
import { useDispatch } from 'react-redux'
import { setPageTitle } from '../../features/common/headerSlice'
import { setUserInfo } from '../../app/store/userinfoSlice'
import {Link} from 'react-router-dom'
import TemplatePointers from '../../features/user/components/TemplatePointers'

function InternalPage(){

    const dispatch = useDispatch()

    useEffect(() => {
        dispatch(setPageTitle({ title : ""}))
      }, [])

     const setTitle = () => {
        dispatch(setUserInfo({
          nickName: 'John Doe',
          avatorUrl: 'https://randomuser.me/api/portraits/men/1.jpg',
          token: 'sampleToken',
          groupName: 'Sample Group',
          groupAvatarUrl: 'https://randomuser.me/api/portraits',
          roleType: 'admin',
      }))
      }

    return(
      <div className="hero h-4/5 bg-base-200">
      <div className="hero-content">
        <div className="max-w-md">
            <TemplatePointers />
            <button className="btn bg-base-100 btn-outline" onClick={()=>setTitle()}>Get Started</button>
        </div>
      </div>
    </div>
    )
}

export default InternalPage